/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import connectivity.QueryManager;
import java.awt.Color;
import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.BorderFactory;
import javax.swing.JOptionPane;
import main.BarApplication;
import model.BmiMeting;
import model.Member;
import net.proteanit.sql.DbUtils;

/**
 *
 * @author Enoch
 */
public class MemberDetail extends javax.swing.JPanel {
    private Member member;
    ResultSet rs = null;
    
    SimpleDateFormat dateForm = new SimpleDateFormat("yyyy-MM-dd");
    Date date = new Date();
    /**
     * Creates new form MemberDetail
     */
    public MemberDetail(Member mem) {
        initComponents();
        this.member = mem;
        memberProfile();
        memberOrder();
        //memberFactuur();
        memberBMITable();
        tableCursusrooster();
        memberCursusInschrijving();
        
        DatumFilter2.setText(dateForm.format(date));
        datumFilter3.setText(dateForm.format(date));
    }
        private void SetData(Object obj, int row_index, int col_index) {
        jTable_productDatail.getModel().setValueAt(obj, row_index, col_index);
    }

    private Object GetData(Object obj, int row_index, int col_index) {
        return jTable_productDatail.getModel().getValueAt(row_index, col_index);
    }
//        private void field() {
//
////        jTextFieldIdLid.setText(Integer.toString(lid.getMemberId()));
////        if (lid.getMiddlename().trim().equals(" ")) {
////
////            jTextFieldVoornaam.setText(lid.getFirstname() + " " + lid.getLastname());
////        } else {
////
////            jTextFieldVoornaam.setText(lid.getFirstname() + " " + lid.getMiddlename() + " " + lid.getLastname());
////        }
//
//        jLabel5.setText("lidnummer: " + member.getMemberId());
//        jLabel6.setText(member.getFirstname() + " " + lid.getMiddlename() + " " + lid.getLastname());
//        jLabel8.setText(member.getAddress());
//        jLabel11.setText(member.getZip_code() + " " + member.getResidence());
//
//    }
    private void memberProfile(){
        jTextField6.setText(this.member.getFirstname());
        jTextField7.setText(this.member.getMiddlename());
        jTextField5.setText(this.member.getLastname());
        jTextField1.setText(this.member.getBirthday());
        jTextField2.setText(this.member.getAddress());
        jTextField3.setText(this.member.getZip_code());
        jTextField9.setText(this.member.getResidence());
        jTextField4.setText(this.member.getTelephoneNumber());
        jTextField14.setText(this.member.getMobilePhone());
        jTextField15.setText(this.member.getEmail());
        jTextField16.setText(this.member.getBankAccount());
    }
    // OrderList table ophalen
    private void memberOrder(){
        QueryManager queryManager = BarApplication.getQueryManager();
        ResultSet result = queryManager.OrderList2(member.getMemberId());
        table_Bestellingen.setModel(DbUtils.resultSetToTableModel(result));
        
    }
    //OrderList filteren op datum
        private void memberOrderFilter(String dat){
        QueryManager queryManager = BarApplication.getQueryManager();
        ResultSet result = queryManager.OrderListFilter2(dat, member.getMemberId());
        table_Bestellingen.setModel(DbUtils.resultSetToTableModel(result));
    }
    //-----------------------------------------------------------------------------
//  Hiermee wordt de TableCususrooster gelinkt aan de database
//------------------------------------------------------------------------------
    private void tableFactuurLidList() {
        String jaar = jComboBox_jaar.getSelectedItem().toString();
        String maand = jComboBox_maand.getSelectedItem().toString();
       QueryManager queryManager = BarApplication.getQueryManager();
        jTable_productDatail.setModel(model.DbUtils.resultSetToTableModel(queryManager.genereerFactuurLidList(member.getMemberId(), jaar, maand)));

    }
//------------------------------------------------------------------------------

    private void tableAbonementLidList() {
        String jaar2 = jComboBox_jaar.getSelectedItem().toString();
        String maand2 = jComboBox_maand.getSelectedItem().toString();
       QueryManager queryManager = BarApplication.getQueryManager();
        jTable_abonement.setModel(model.DbUtils.resultSetToTableModel(queryManager.genereerAbonementLidList(member.getMemberId(), jaar2, maand2)));
        //jTable_productDatail.removeColumn(jTable_productDatail.getColumnModel().getColumn(0)); // REMOVE FISRT COLUMN 
    }
    //BMI table
    private void memberBMITable(){
        QueryManager queryManager = BarApplication.getQueryManager();
        ResultSet result = queryManager.getBMI2(member.getMemberId());
        BMITable.setModel(DbUtils.resultSetToTableModel(result));
    }
    //BMI filteren op datum
    private void memberBMIFilter(String dat){
        QueryManager queryManager = BarApplication.getQueryManager();
        ResultSet result = queryManager.MBIFilter2(dat, member.getMemberId());
        BMITable.setModel(DbUtils.resultSetToTableModel(result));
    }
        private void tableCursusrooster() {
        QueryManager queryManager = BarApplication.getQueryManager();
        cursussen.setModel(DbUtils.resultSetToTableModel(queryManager.CususroosterList2(rs)));
        cursussen.removeColumn(cursussen.getColumnModel().getColumn(0));
        cursussen.removeColumn(cursussen.getColumnModel().getColumn(0));
        cursussen.removeColumn(cursussen.getColumnModel().getColumn(1));// REMOVE FISRT COLUMN 
    }
        private void memberCursusInschrijving() {
        QueryManager queryManager = BarApplication.getQueryManager();
        mijnCursussen.setModel(DbUtils.resultSetToTableModel(queryManager.lidCursusroosterList(member.getMemberId())));
        mijnCursussen.removeColumn(mijnCursussen.getColumnModel().getColumn(0)); // REMOVE FISRT COLUMN 
    }
    
    //Zet de BMI waardes in de velden.
    private void BMI() {
            double kilograms = Double.parseDouble(gewicht.getText());
            double meters = Double.parseDouble(lengte.getText());
            double bmi = (int) computeBMI(kilograms, meters);
            BMI.setText("" + bmi);
        }

    //Berekend de BMI
    public static double computeBMI(double weight, double height) {
        return weight / (height * height);
    }
   

    
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane2 = new javax.swing.JTabbedPane();
        jPanel6 = new javax.swing.JPanel();
        jPanel7 = new javax.swing.JPanel();
        jButton4 = new javax.swing.JButton();
        jButton14 = new javax.swing.JButton();
        jPanel8 = new javax.swing.JPanel();
        jTextField6 = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        jPanel9 = new javax.swing.JPanel();
        jLabel11 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jTextField2 = new javax.swing.JTextField();
        jTextField3 = new javax.swing.JTextField();
        jTextField4 = new javax.swing.JTextField();
        jTextField5 = new javax.swing.JTextField();
        jTextField7 = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jTextField9 = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jTextField14 = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jTextField15 = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jTextField16 = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jPanel15 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        table_Bestellingen = new javax.swing.JTable();
        jPanel38 = new javax.swing.JPanel();
        DatumFilter2 = new javax.swing.JTextField();
        orderSearch = new javax.swing.JButton();
        jPanel32 = new javax.swing.JPanel();
        jScrollPane8 = new javax.swing.JScrollPane();
        mijnCursussen = new javax.swing.JTable();
        jPanel37 = new javax.swing.JPanel();
        jTextField12 = new javax.swing.JTextField();
        jButton2 = new javax.swing.JButton();
        jButton_Cursusinschrijving = new javax.swing.JButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        cursussen = new javax.swing.JTable();
        jPanel2 = new javax.swing.JPanel();
        jPanel14 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        jTable_productDatail = new javax.swing.JTable();
        jPanel3 = new javax.swing.JPanel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jComboBox_jaar = new javax.swing.JComboBox();
        jComboBox_maand = new javax.swing.JComboBox();
        jButton1 = new javax.swing.JButton();
        jScrollPane5 = new javax.swing.JScrollPane();
        jTable_abonement = new javax.swing.JTable();
        totaal_bedrag = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jPanel39 = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        jPanel17 = new javax.swing.JPanel();
        lengte = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        gewicht = new javax.swing.JTextField();
        BMI = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        berekenBMI = new javax.swing.JButton();
        jPanel19 = new javax.swing.JPanel();
        datumFilter3 = new javax.swing.JTextField();
        OplaanBMI = new javax.swing.JButton();
        SearchDatumBMI = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        BMITable = new javax.swing.JTable();
        jPanel_menu = new javax.swing.JPanel();
        jLabel17 = new javax.swing.JLabel();

        setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));

        jTabbedPane2.setBackground(new java.awt.Color(102, 102, 102));
        jTabbedPane2.setTabLayoutPolicy(javax.swing.JTabbedPane.SCROLL_TAB_LAYOUT);
        jTabbedPane2.setTabPlacement(javax.swing.JTabbedPane.LEFT);
        jTabbedPane2.setToolTipText("");
        jTabbedPane2.setMinimumSize(new java.awt.Dimension(161, 100));

        jPanel7.setBackground(new java.awt.Color(204, 204, 204));

        jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/edit-icon.png"))); // NOI18N
        jButton4.setText("Wijziging opslaan");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jButton14.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/Devices-printer-icon.png"))); // NOI18N

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addComponent(jButton4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jButton14)
                .addContainerGap())
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton4)
                    .addComponent(jButton14))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel8.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jTextField6.setEditable(false);
        jTextField6.setHorizontalAlignment(javax.swing.JTextField.LEFT);

        jLabel9.setText("Geboortedatum");

        jLabel10.setText("Naam");

        jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);

        jPanel9.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/User.png"))); // NOI18N

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addGap(32, 32, 32)
                .addComponent(jLabel11)
                .addContainerGap(33, Short.MAX_VALUE))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel11)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTextField1.setEditable(false);

        jTextField5.setEditable(false);
        jTextField5.setHorizontalAlignment(javax.swing.JTextField.LEFT);

        jTextField7.setEditable(false);
        jTextField7.setHorizontalAlignment(javax.swing.JTextField.LEFT);
        jTextField7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField7ActionPerformed(evt);
            }
        });

        jLabel1.setText("Adres");

        jLabel2.setText("Postcode + Plaats");

        jLabel3.setText("Telefoonummers");

        jLabel4.setText("Nr2");

        jLabel5.setText("E-mail");

        jTextField16.setEditable(false);

        jLabel6.setText("Rekeningnummer");

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addGap(2, 2, 2)
                        .addComponent(jLabel10))
                    .addComponent(jLabel9)
                    .addComponent(jLabel1)
                    .addComponent(jLabel2)
                    .addComponent(jLabel3)
                    .addComponent(jLabel5)
                    .addComponent(jLabel6))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jTextField15, javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel8Layout.createSequentialGroup()
                        .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jTextField14, javax.swing.GroupLayout.PREFERRED_SIZE, 233, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel8Layout.createSequentialGroup()
                        .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField9))
                    .addComponent(jTextField2, javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextField1, javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel8Layout.createSequentialGroup()
                        .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jTextField16))
                .addGap(18, 18, Short.MAX_VALUE)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(49, 49, 49))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel10)
                            .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel9)
                            .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel1))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jLabel2))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel3))
                            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jTextField14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel4)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTextField15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel5))
                        .addGap(10, 10, 10)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTextField16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel6)))
                    .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(69, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, 775, Short.MAX_VALUE)
                    .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGap(6, 6, 6)
                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(106, 106, 106))
        );

        jTabbedPane2.addTab(" Lid Profiel        ", new javax.swing.ImageIcon(getClass().getResource("/images/icon-48-user.png")), jPanel6); // NOI18N

        table_Bestellingen.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        table_Bestellingen.setAutoCreateRowSorter(true);
        jScrollPane1.setViewportView(table_Bestellingen);

        jPanel38.setBackground(new java.awt.Color(153, 153, 153));

        DatumFilter2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                DatumFilter2ActionPerformed(evt);
            }
        });

        orderSearch.setText("Search");
        orderSearch.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                orderSearchActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel38Layout = new javax.swing.GroupLayout(jPanel38);
        jPanel38.setLayout(jPanel38Layout);
        jPanel38Layout.setHorizontalGroup(
            jPanel38Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel38Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(DatumFilter2, javax.swing.GroupLayout.PREFERRED_SIZE, 256, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(orderSearch)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel38Layout.setVerticalGroup(
            jPanel38Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel38Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel38Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(DatumFilter2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(orderSearch))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15Layout.setHorizontalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel15Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel38, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 775, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel15Layout.setVerticalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel15Layout.createSequentialGroup()
                .addComponent(jPanel38, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 332, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(62, Short.MAX_VALUE))
        );

        jTabbedPane2.addTab("Lid Bestellingen     ", new javax.swing.ImageIcon(getClass().getResource("/images/icon-48-stats.png")), jPanel15); // NOI18N

        mijnCursussen.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        mijnCursussen.setAutoCreateRowSorter(true);
        jScrollPane8.setViewportView(mijnCursussen);

        jPanel37.setBackground(new java.awt.Color(153, 153, 153));

        jButton2.setText("Search");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton_Cursusinschrijving.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/add-1-icon.png"))); // NOI18N
        jButton_Cursusinschrijving.setText("Cursusinschrijving");
        jButton_Cursusinschrijving.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton_CursusinschrijvingMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel37Layout = new javax.swing.GroupLayout(jPanel37);
        jPanel37.setLayout(jPanel37Layout);
        jPanel37Layout.setHorizontalGroup(
            jPanel37Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel37Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTextField12, javax.swing.GroupLayout.PREFERRED_SIZE, 256, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 261, Short.MAX_VALUE)
                .addComponent(jButton_Cursusinschrijving)
                .addGap(22, 22, 22))
        );
        jPanel37Layout.setVerticalGroup(
            jPanel37Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel37Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel37Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton2)
                    .addComponent(jButton_Cursusinschrijving))
                .addContainerGap())
        );

        cursussen.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        cursussen.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                cursussenMouseClicked(evt);
            }
        });
        jScrollPane3.setViewportView(cursussen);

        jPanel2.setBackground(new java.awt.Color(204, 204, 204));

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 34, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout jPanel32Layout = new javax.swing.GroupLayout(jPanel32);
        jPanel32.setLayout(jPanel32Layout);
        jPanel32Layout.setHorizontalGroup(
            jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel32Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel37, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 775, Short.MAX_VALUE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.TRAILING))
                .addContainerGap())
        );
        jPanel32Layout.setVerticalGroup(
            jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel32Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel37, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTabbedPane2.addTab(" Lid cursus            ", new javax.swing.ImageIcon(getClass().getResource("/images/icon-48-category.png")), jPanel32); // NOI18N

        jTable_productDatail.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Producten", "Aantal", "Prijs per stuk", "Totaal"
            }
        ));
        jTable_productDatail.setShowVerticalLines(false);
        jScrollPane4.setViewportView(jTable_productDatail);

        jPanel3.setBackground(new java.awt.Color(204, 255, 204));

        jLabel15.setText("Jaar");

        jLabel16.setText("Maand");

        jComboBox_jaar.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecteer een jaar", "2012", "2013", " " }));

        jComboBox_maand.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecteer een maand", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12" }));

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/invoice-icon.png"))); // NOI18N
        jButton1.setText("Genereer Factuur");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel16)
                            .addComponent(jLabel15))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jComboBox_jaar, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jComboBox_maand, 0, 145, Short.MAX_VALUE)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(jButton1)))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jComboBox_jaar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel16)
                    .addComponent(jComboBox_maand, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jButton1)
                .addContainerGap(289, Short.MAX_VALUE))
        );

        jTable_abonement.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {}
            },
            new String [] {

            }
        ));
        jTable_abonement.setMaximumSize(new java.awt.Dimension(700, 16));
        jTable_abonement.setShowVerticalLines(false);
        jScrollPane5.setViewportView(jTable_abonement);

        totaal_bedrag.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        totaal_bedrag.setText("€ 0.00");

        jLabel21.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel21.setText("Te betalen");

        jLabel22.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel22.setForeground(new java.awt.Color(102, 102, 102));
        jLabel22.setText("Soort abonnement");

        jPanel39.setBackground(new java.awt.Color(153, 153, 153));

        javax.swing.GroupLayout jPanel39Layout = new javax.swing.GroupLayout(jPanel39);
        jPanel39.setLayout(jPanel39Layout);
        jPanel39Layout.setHorizontalGroup(
            jPanel39Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        jPanel39Layout.setVerticalGroup(
            jPanel39Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 45, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel39, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel14Layout.createSequentialGroup()
                        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 564, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel14Layout.createSequentialGroup()
                                .addComponent(jLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel21)
                                .addGap(37, 37, 37)
                                .addComponent(totaal_bedrag, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(24, 24, 24))
                            .addComponent(jScrollPane4))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())))
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addComponent(jPanel39, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel14Layout.createSequentialGroup()
                        .addGap(17, 17, 17)
                        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel22)
                            .addComponent(jLabel21)
                            .addComponent(totaal_bedrag))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(54, 54, 54)
                        .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 273, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel14Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTabbedPane2.addTab("Lid Factuur        ", new javax.swing.ImageIcon(getClass().getResource("/images/Purse_64.png")), jPanel14); // NOI18N

        jPanel17.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel17.setAlignmentX(0.0F);
        jPanel17.setAlignmentY(0.0F);

        jLabel12.setText("Gewicht ( in kg.)");

        jLabel13.setText("Lengte (in cm.)");

        BMI.setEditable(false);
        BMI.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
        BMI.setForeground(new java.awt.Color(0, 0, 204));

        jLabel7.setText("Uw BMI is ");

        berekenBMI.setText("Bereken");
        berekenBMI.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                berekenBMIActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17);
        jPanel17.setLayout(jPanel17Layout);
        jPanel17Layout.setHorizontalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel17Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel13)
                    .addComponent(jLabel12)
                    .addComponent(jLabel7))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(berekenBMI)
                    .addComponent(BMI, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(gewicht, javax.swing.GroupLayout.PREFERRED_SIZE, 271, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lengte, javax.swing.GroupLayout.PREFERRED_SIZE, 271, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel17Layout.setVerticalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel17Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(lengte, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(gewicht, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel12))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(BMI, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7))
                .addGap(18, 18, 18)
                .addComponent(berekenBMI)
                .addContainerGap(144, Short.MAX_VALUE))
        );

        jPanel19.setBackground(new java.awt.Color(153, 153, 153));

        OplaanBMI.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/Devices-media-floppy-icon.png"))); // NOI18N
        OplaanBMI.setText("Opslaan");
        OplaanBMI.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        OplaanBMI.setInheritsPopupMenu(true);
        OplaanBMI.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                OplaanBMIActionPerformed(evt);
            }
        });

        SearchDatumBMI.setText("Search");
        SearchDatumBMI.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SearchDatumBMIActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel19Layout = new javax.swing.GroupLayout(jPanel19);
        jPanel19.setLayout(jPanel19Layout);
        jPanel19Layout.setHorizontalGroup(
            jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel19Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(datumFilter3, javax.swing.GroupLayout.PREFERRED_SIZE, 256, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(SearchDatumBMI)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 302, Short.MAX_VALUE)
                .addComponent(OplaanBMI)
                .addGap(29, 29, 29))
        );
        jPanel19Layout.setVerticalGroup(
            jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel19Layout.createSequentialGroup()
                .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel19Layout.createSequentialGroup()
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(OplaanBMI))
                    .addGroup(jPanel19Layout.createSequentialGroup()
                        .addGap(19, 19, 19)
                        .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(datumFilter3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(SearchDatumBMI))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );

        BMITable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        BMITable.setAutoCreateRowSorter(true);
        jScrollPane2.setViewportView(BMITable);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel19, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 392, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jPanel19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addComponent(jPanel17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(84, Short.MAX_VALUE))
        );

        jTabbedPane2.addTab(" lid BMI                 ", new javax.swing.ImageIcon(getClass().getResource("/images/size32/BMI_32x32.jpg")), jPanel1); // NOI18N

        jLabel17.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/Apps-session-logout-icon.png"))); // NOI18N
        jLabel17.setText("logout");
        jLabel17.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabel17MouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel_menuLayout = new javax.swing.GroupLayout(jPanel_menu);
        jPanel_menu.setLayout(jPanel_menuLayout);
        jPanel_menuLayout.setHorizontalGroup(
            jPanel_menuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel_menuLayout.createSequentialGroup()
                .addContainerGap(885, Short.MAX_VALUE)
                .addComponent(jLabel17)
                .addContainerGap())
        );
        jPanel_menuLayout.setVerticalGroup(
            jPanel_menuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel17)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 961, Short.MAX_VALUE)
            .addComponent(jPanel_menu, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(jPanel_menu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTabbedPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 450, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void OplaanBMIActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_OplaanBMIActionPerformed
       BmiMeting bmiMeting = new BmiMeting();
       bmiMeting.setBmiMeting(Double.parseDouble(BMI.getText()));
       bmiMeting.setLidnummer(member.getMemberId());
       bmiMeting.insert();
     //refresh BMI tabel  
       memberBMITable();
    }//GEN-LAST:event_OplaanBMIActionPerformed

    private void jTextField7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField7ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField7ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        // TODO add your handling code here:
        
      //Zet de gegevens in de velden van het lid profiel  
        member.setTelephoneNumber(jTextField4.getText());
        member.setMobilePhone(jTextField14.getText());
        member.setResidence(jTextField9.getText());
        member.setZip_code(jTextField3.getText());
        member.setAddress(jTextField2.getText());
        member.setEmail(jTextField15.getText());
        
        if (jTextField2.getText().equals("")) {

            jTextField2.setBorder(BorderFactory.createMatteBorder(0, 0, 5, 0, Color.PINK));
            JOptionPane.showMessageDialog(this, "Adres kan niet leeg zijn!", "Adres", JOptionPane.ERROR_MESSAGE);
        }
        else if (jTextField3.getText().equals("")) {

            jTextField3.setBorder(BorderFactory.createMatteBorder(0, 0, 5, 0, Color.PINK));
            JOptionPane.showMessageDialog(this, "Postcode kan niet leeg zijn!", "Post Code", JOptionPane.ERROR_MESSAGE);
        }
        else if (jTextField9.getText().equals("")) {

            jTextField9.setBorder(BorderFactory.createMatteBorder(0, 0, 5, 0, Color.PINK));
            JOptionPane.showMessageDialog(this, "Woonplaats kan niet leeg zijn!", "Woonplaats", JOptionPane.ERROR_MESSAGE);
        }
        else if (jTextField4.getText().equals("")) {

            jTextField4.setBorder(BorderFactory.createMatteBorder(0, 0, 5, 0, Color.PINK));
            JOptionPane.showMessageDialog(this, "telefoonnummer kan niet leeg zijn!", "Telefoonnummer", JOptionPane.ERROR_MESSAGE);
        }
        else if (jTextField15.getText().equals("")) {

            jTextField15.setBorder(BorderFactory.createMatteBorder(0, 0, 5, 0, Color.PINK));
            JOptionPane.showMessageDialog(this, "Email kan niet leeg zijn!", "Email", JOptionPane.ERROR_MESSAGE);
        }
        else {
            member.update();
        }
        
    }//GEN-LAST:event_jButton4ActionPerformed
        //BMI zoeken op datum
    private void SearchDatumBMIActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SearchDatumBMIActionPerformed

        if (datumFilter3.getText().equals("")){
            memberBMITable();
        }else{
            memberBMIFilter(datumFilter3.getText());
        }    
    }//GEN-LAST:event_SearchDatumBMIActionPerformed
    private void orderSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_orderSearchActionPerformed
        //  Zoeken naar de order op datum
        if (DatumFilter2.getText().equals("")){
            memberOrder();
        }else{
        memberOrderFilter(DatumFilter2.getText());
        }       
        
    }//GEN-LAST:event_orderSearchActionPerformed
//  Zoeken naar de order op datum
    private void DatumFilter2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DatumFilter2ActionPerformed
        
    }//GEN-LAST:event_DatumFilter2ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton2ActionPerformed

    private void berekenBMIActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_berekenBMIActionPerformed
        //De button om de bmi berekining uit te voeren
        BMI();
        memberBMITable();
    }//GEN-LAST:event_berekenBMIActionPerformed

    private void cursussenMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cursussenMouseClicked
        
        
    }//GEN-LAST:event_cursussenMouseClicked

    private void jButton_CursusinschrijvingMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton_CursusinschrijvingMouseClicked
        
       String idcursussen = (cursussen.getModel().getValueAt(cursussen.getSelectedRow(), 0).toString());
       String productnummer = (cursussen.getModel().getValueAt(cursussen.getSelectedRow(), 1).toString());
       String idvestiging = (cursussen.getModel().getValueAt(cursussen.getSelectedRow(), 3).toString()); 
       
       
       
       boolean found = false;
        for(int i =0; i < mijnCursussen.getRowCount(); i++){
            if ( mijnCursussen.getModel().getValueAt(i, 0).toString().equals(idcursussen)){
                  found = true;
                  break;
            }
        }
        if ( !found ) {
            QueryManager queryManager = BarApplication.getQueryManager();
            queryManager.setLidcursusrooster(member.getMemberId(), Integer.parseInt(idcursussen));
            queryManager.setOrder1(member.getMemberId(), Integer.parseInt(idvestiging), Integer.parseInt(productnummer));
            
            memberCursusInschrijving();
       
               }
        else {
            JOptionPane.showMessageDialog(this, "Cursus is al geselecteerd!", "Cursus", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_jButton_CursusinschrijvingMouseClicked

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        //        if (jComboBox_jaar.getSelectedIndex() == 0) {
            //            JOptionPane.showMessageDialog(this, "Selecteer een jaar", "Jaar", JOptionPane.ERROR_MESSAGE);
            //        } else {
            //            if (jComboBox_maand.getSelectedIndex() == 0) {
                //                JOptionPane.showMessageDialog(this, "Selecteer een maand", "Maand", JOptionPane.ERROR_MESSAGE);
                //            } else {
                //                String jaar = jComboBox_jaar.getSelectedItem().toString();
                //                String maand = jComboBox_maand.getSelectedItem().toString();
                //                try {
                    //
                    //                    queryManager = BarApplication.getQueryManager();
                    //                    List<Factuur> facturen = BarApplication.getQueryManager().getFactuurNummer(jaar, maand);
                    //                    for (int i = 0; i < facturen.size(); i++) {
                        //                        System.out.println("Bezig met generen van factuurnummer: " + facturen.get(i).getFactuurNummer());
                        //                        int factuurnummer = facturen.get(i).getFactuurNummer();
                        //                        System.out.println("factuurnummer=" + factuurnummer);
                        //                        CreatePdfFactuur pdf = new CreatePdfFactuur(queryManager.getFactuurLid(factuurnummer),
                            //                                queryManager.getBarBonFactuur(factuurnummer) // queryManager.getCursusFactuur(factuurnummer)
                            //                                );
                        //                        Thread.sleep(10000);
                        //                    }
                    //                } catch (Exception ex) {
                    //                    System.out.println("Problemen bij generenen facturen: " + ex);
                    //                }
                //                System.out.println("Done!");
                //            }
            //        }
        tableFactuurLidList();
        tableAbonementLidList();

        double obj1 = 0;
        int col_index = jTable_abonement.getColumnCount() - 1;
        int row_index = jTable_abonement.getRowCount() - 1;
        if (row_index >= 0 && col_index > 0) {
            obj1 = Double.parseDouble(jTable_abonement.getModel().getValueAt(row_index, col_index).toString());
            System.out.println(obj1);
        }

        double obj2 = 0;
        int j = jTable_productDatail.getColumnCount() - 1;
        int rows = jTable_productDatail.getRowCount();
        for (int i = 0; i < rows; i++) {
            obj2 += Double.parseDouble(GetData(jTable_productDatail, i, j).toString());
        }
        // SetData(new Double(obj1),rows-1,j);
        double totaal = obj1 + obj2;

        totaal_bedrag.setText("€ " + String.format("%1$,.2f", totaal));
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jLabel17MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel17MouseClicked
        // TODO add your handling code here:
        BarApplication.getInstance().showPanel(new LoginScreen());
    }//GEN-LAST:event_jLabel17MouseClicked

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField BMI;
    private javax.swing.JTable BMITable;
    private javax.swing.JTextField DatumFilter2;
    private javax.swing.JButton OplaanBMI;
    private javax.swing.JButton SearchDatumBMI;
    private javax.swing.JButton berekenBMI;
    private javax.swing.JTable cursussen;
    private javax.swing.JTextField datumFilter3;
    private javax.swing.JTextField gewicht;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton14;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton_Cursusinschrijving;
    private javax.swing.JComboBox jComboBox_jaar;
    private javax.swing.JComboBox jComboBox_maand;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel17;
    private javax.swing.JPanel jPanel19;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel32;
    private javax.swing.JPanel jPanel37;
    private javax.swing.JPanel jPanel38;
    private javax.swing.JPanel jPanel39;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    public javax.swing.JPanel jPanel_menu;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JTabbedPane jTabbedPane2;
    private javax.swing.JTable jTable_abonement;
    private javax.swing.JTable jTable_productDatail;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField12;
    private javax.swing.JTextField jTextField14;
    private javax.swing.JTextField jTextField15;
    private javax.swing.JTextField jTextField16;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextField4;
    private javax.swing.JTextField jTextField5;
    private javax.swing.JTextField jTextField6;
    private javax.swing.JTextField jTextField7;
    private javax.swing.JTextField jTextField9;
    private javax.swing.JTextField lengte;
    private javax.swing.JTable mijnCursussen;
    private javax.swing.JButton orderSearch;
    private javax.swing.JTable table_Bestellingen;
    private javax.swing.JLabel totaal_bedrag;
    // End of variables declaration//GEN-END:variables
}
